<?php
namespace app\web\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author
 */
class Package extends Validate
{
    //定义验证规则
    protected $rule = [
        'sort|序号'  => 'require',
        'name|套餐名称'  => 'require',
        'price|套餐价格'  => 'require',
        'type|套餐类型' =>'require',
        'project_name|套餐商品' =>'require',
    ];
    //定义验证提示
    protected $message = [
        'sort.require' => '序号必须填写',
        'name.require' => '套餐名称必须填写',
        'price.require' => '套餐价格必须填写',
        'type.require' => '套餐类型必须填写',
        'project_name.require' => '套餐商品不能为空',
    ];
    //定义验证场景
    protected $scene = [
        'add'   =>  ['sort','name','price','time','type','project_name'],
    ];
}
